// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

const int N = 1e5+50, M = 1 << 7;


struct ios {
    inline char read(){
        static const int IN_LEN=1<<18|1;
        static char buf[IN_LEN],*s,*t;
        return (s==t)&&(t=(s=buf)+fread(buf,1,IN_LEN,stdin)),s==t?-1:*s++;
    }

    template <typename _Tp> inline ios & operator >> (_Tp&x){
        static char c11,boo;
        for(c11=read(),boo=0;!isdigit(c11);c11=read()){
            if(c11==-1)return *this;
            boo|=c11=='-';
        }
        for(x=0;isdigit(c11);c11=read())x=x*10+(c11^'0');
        boo&&(x=-x);
        return *this;
    }

    int read(char *s) {
        int len = 0;
        char ch;
        for (ch=read(); ch=='\n' || ch == ' '; ch=read());
        if (ch == -1) {
            s[len] = 0;
            return -1;
        }
        for (; ch!='\n' && ch != ' ' && ch != -1;ch=read())
            s[len++] = ch;
        s[len] = 0;
        return len;
    }
} io;
typedef long long LL;

struct People {
    int a, s[7];
} dat[N];

LL dp[N][M];

int s[N][7];
int n, p, k;

inline bool cmp(const People &a, const People &b)
{
    return a.a > b.a;
}

int bitcnt[N];

void init() {
    for (int j=0; j<M; ++j) {
        int t = j;
        while (t) {
            bitcnt[j] += t & 1;
            t >>= 1;
        }
    }
}

inline void update(LL &a, LL b) {
    a = max(a, b);
}

int main(int argc, char const *argv[]) {
    init();
    io >> n >> p >> k;
    for (int i=1; i<=n; ++i)
        io >> dat[i].a;

    for (int i=1; i<=n; ++i)
        for (int j=0; j<p; ++j)
            io >> dat[i].s[j];

    sort(dat+1, dat+n+1, cmp);

    memset(dp, -1, sizeof dp);
    dp[0][0] = 0;
    for (int i=1; i<=k; ++i)
        dp[0][0] += dat[i].a;
    int lim = (1 << p);
    for (int i=0; i<n; ++i)
        for (int j=0; j<lim; ++j)
        {
            if (dp[i][j] == -1) continue;
            int players = bitcnt[j];
            LL acost, pcost[7], offset;
            if (i+1 <= players + k) {
                acost = 0;
                offset = dat[players + 1 + k].a - dat[i+1].a;
            } else {
                acost = 0;
                offset = 0;
            }

            for (int pos=0; pos<7; ++pos)
                pcost[pos] = dat[i+1].s[pos] + offset;
            update(dp[i+1][j], dp[i][j] + acost);
            for (int pos=0; pos<7; ++pos) if (((j >> pos) & 1) == 0) {
                update(dp[i+1][j ^ (1 << pos)], dp[i][j] + pcost[pos]);
            }
        }
    // dbg(dp[2][0]);
    printf("%lld\n", dp[n][lim-1]);
    return 0;
}
